import { defineStore } from "pinia";
import {ref} from 'vue'
import { messageTypeListService } from "@/api/message.js";
const useRolesStore = defineStore('roles',()=>{
    //定义状态相关的内容
    const info = ref({})

    //修改状态的值
    const setInfo = (newInfo) => {
        info.value = newInfo;
    }
    //清除状态的值
    const removeInfo = () => {
        info.value = {}
    }
    //获取消息类型
    const initialRoles = async () => {
        let result = await messageTypeListService();
        info.value = result.data;
        console.log(info.value);
    }
    return {info,setInfo,removeInfo,initialRoles}
},{persist:true})

export default useRolesStore;


